//
//  LWAccountAddressCell.m
//  LWShopItem
//
//  Created by apple on 17/5/7.
//  Copyright © 2017年 LWShop.com. All rights reserved.
//

#import "LWAccountAddressCell.h"
#import "Masonry.h"
#import "LWAccountModel.h"
@interface LWAccountAddressCell()

@property (weak,nonatomic)UILabel *nameLabel;

@property (weak,nonatomic)UILabel *phoneLabel;

@property (weak,nonatomic)UILabel *addressLabel;

@property (strong,nonatomic)UITextField *addContactTextfild;

@end

@implementation LWAccountAddressCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
    
}

#pragma MARK - UI
- (void)setupUI
{
    
    //收货人
    UILabel *nameL = [UILabel new];
    nameL.text = @"张三";
    [self.contentView addSubview:nameL];
    
    self.nameLabel = nameL;
    
    [nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.top.equalTo(self.contentView).offset(20);
        
    }];
    
    //收货电话
    UILabel *phoneLabel = [UILabel new];
    phoneLabel.text = @"18888888888";
    [self.contentView addSubview:phoneLabel];
    
    self.phoneLabel = phoneLabel;
    
    [phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(20);
        
        make.left.equalTo(nameL.mas_right).offset(10);
        
    }];
    
    //收货详细地址
    UILabel *addressLabel = [UILabel new];
    addressLabel.text = @"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    addressLabel.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:addressLabel];
    
    self.addressLabel = addressLabel;
    
    [addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(nameL.mas_bottom).offset(10);
        
        make.left.equalTo(self.contentView).offset(20);
        
    }];
    
}

- (void)setModel:(LWAccountModel *)model
{
    _model = model;
    
    self.nameLabel.text = model.consignee;
    self.phoneLabel.text = model.mobile;
    self.addressLabel.text = model.address;
    
}


@end
